package org.springblade.common.utils.smsutils;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.extern.slf4j.Slf4j;


@Slf4j
public class SMSUtils {

    static AbsRestClient InstantiationRestAPI() {
        return new JsonReqClient();
    }


    public static void testSendSms(String templateid, String param, String mobile) {
        try {
            String uuid = IdWorker.getIdStr();
            String result = InstantiationRestAPI().sendSms(UCPaasSMSConfig.AccountSid, UCPaasSMSConfig.AuthToken, UCPaasSMSConfig.AppID, templateid, param, mobile, uuid);
            log.info("Response content is: " + result);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void testSendSmsBatch(String templateid, String param, String mobile) {
        try {
            String uuid = IdWorker.getIdStr();
            String result = InstantiationRestAPI().sendSmsBatch(UCPaasSMSConfig.AccountSid, UCPaasSMSConfig.AuthToken, UCPaasSMSConfig.AppID, templateid, param, mobile, uuid);
            log.info("Response content is: " + result);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


//    public static void main(String[] args) throws IOException {
//        String params = "c" + "," + "";
//        testSendSms(UCPaasSMSConfig.MESSAGETTMPLATE_LOGIN, "1234,5", "17206406396");
//    }


}
